//
//  DYShopCardSetVC.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/25.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYShopCardSetVC.h"
#import "DYAddBranchShopCell.h"
#import "DYShopDecorateInputInfoCell.h"
#import "DYShopCardSetCell.h"
#import "DYShopCardSetFooterView.h"

@interface DYShopCardSetVC ()

@property (nonatomic,strong)NSArray *titleArray;
@property (nonatomic,strong)NSArray *placeholderArray;
@property (nonatomic,strong)DYShopCardSetFooterView *footerView;

@end

@implementation DYShopCardSetVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
-(void)dy_initData
{
    [super dy_initData];
    
    self.navigationItem.title=@"卡片设置";
    self.titleArray=@[@"",@"电话",@"特权说明",@"使用须知",@"购买说明",@"充值说明"];
    self.placeholderArray=@[@"",@"请输入店铺联系电话",@"请输入卡片特权说明...",@"请输入卡片使用须知...",@"请输入开盘购买说明...",@"请输入卡片充值说明..."];
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    
    self.tableView.backgroundColor=WhiteColor;
    [self.tableView registerClass:[DYAddBranchShopCell
                                   class] forCellReuseIdentifier:@"DYAddBranchShopCell"];
    [self.tableView registerClass:[DYShopDecorateInputInfoCell
                                   class] forCellReuseIdentifier:@"DYShopDecorateInputInfoCell"];
    [self.tableView registerClass:[DYShopCardSetCell
                                   class] forCellReuseIdentifier:@"DYShopCardSetCell"];
    
    self.tableView.tableFooterView=self.footerView;
    
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 6;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==0) {
        return BILIHEIGHT(120);
    }else if (indexPath.row==1){
      return BILIHEIGHT(58);
    }
    return BILIHEIGHT(180);
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==0) {
        DYShopCardSetCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYShopCardSetCell" forIndexPath:indexPath];
        return cell;
    }else if (indexPath.row==1){
        DYAddBranchShopCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYAddBranchShopCell" forIndexPath:indexPath];
        cell.titleLabel.text=self.titleArray[indexPath.row];
        cell.textField.placeholder=self.placeholderArray[indexPath.row];
        [cell.textField setNumbersKeyboard];
        return cell;
    }
    DYShopDecorateInputInfoCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYShopDecorateInputInfoCell" forIndexPath:indexPath];
    cell.titleLabel.text=self.titleArray[indexPath.row];
    cell.infoTextView.dy_placeHolder=self.placeholderArray[indexPath.row];
    cell.hideSeparatorLabel=YES;
    return cell;
}
-(DYShopCardSetFooterView *)footerView
{
    if (!_footerView) {
        _footerView=[[DYShopCardSetFooterView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, BILIHEIGHT(90))];
    }
    return _footerView;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
